<div class="fieldsets">
  <% form_tag :action => 'update_rss_feed', :feed_id => @feed do %>

    <%= render :partial => 'feed_settings' %>

    <% field_set_tag 'Projects' do %>
      <p>Select projects below to include all activities of these projects in your feed:</p>
      <ul class="feed_elements">
        <% for project in Project.find_active %>
          <li><%= check_box_tag(dom_id(project), "1", @feed.elements.projects.include?(project.id)) %>
          <label for="<%= dom_id(project) %>"><%= h project.name %></label></li>
        <% end %>
      </ul>
    <% end %>

    <% field_set_tag 'Roles' do %>
      <p>Select user roles below to include all activities of all users with these roles in your feed:</p>
      <ul class="feed_elements">
        <% for role in Role.find(:all, :order => 'name') %>
          <li><%= check_box_tag(dom_id(role), "1", @feed.elements.roles.include?(role.id)) %>
          <label for="<%= dom_id(role) %>"><%= h role.name %></label></li>
        <% end %>
      </ul>
    <% end %>

    <% field_set_tag 'Users' do %>
      <p>Select users below to include all their activities in your feed:</p>
      <ul class="feed_elements">
        <% for user in User.find_active %>
          <li><%= check_box_tag(dom_id(user), "1", @feed.elements.users.include?(user.id)) %>
          <label for="<%= dom_id(user) %>"><%= h user.name %></label></li>
        <% end %>
      </ul>
    <% end %>

    <p><%= submit_tag 'Save changes', :style => 'margin: 10px; margin-left: 30px;' %></p>
  <% end %>
</div>
